--粗夯求进
local cufengqiujing = fk.CreateSkill {
    name = "mcdh_cufengqiujing"
}

cufengqiujing:addEffect(fk.CardUseFinished,{
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(self) and target == player and data.card.type == Card.TypeBasic and not player:isKongcheng() and
        table.every(player:getCardIds("h"),function(id) return Fk:getCardById(id).type == Card.TypeBasic  end)
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        local cards = {}
        local flag = false
        repeat
            local id = room:getNCards(1)[1]
            room:moveCardTo(id, Card.Processing, nil, fk.ReasonJustMove, self.name)
            room:delay(200)
            local card  = Fk:getCardById(id)
            if card.type == Card.TypeEquip or card:isCommonTrick() then
                room:moveCards({
                    ids = {id} ,
                    from = nil,
                    to = player.id,
                    toArea = Card.PlayerHand,
                    moveReason = fk.ReasonPrey,
                    skillName =  self.name,
                    moveVisible = true
                })
                flag = true
            else
                table.insertIfNeed(cards,id)
            end
        until  player.dead or flag
        if #cards > 0 then
            room:moveCards({
                ids = cards ,
                from = nil,
                to = nil,
                toArea = Card.DiscardPile,
                moveReason = fk.ReasonPutIntoDiscardPile,
                skillName =  self.name,
                moveVisible = true
            })
        end
    end
})


Fk:loadTranslationTable {
    ["mcdh_cufengqiujing"] = "粗进",
    [":mcdh_cufengqiujing"] = "『粗夯求进』<br>你当你使用基本牌后，若你的手牌均为基本牌，你可以依次亮出牌堆顶的一张牌，获得第一张亮出的装备牌或普通锦囊牌.",
}

return cufengqiujing